<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.google.gson.Gson"%>
<%
	String path = request.getContextPath();
	String basePath ="/hhcommon/opensource/mxgraph/examples/editors/";
	Gson gson = new Gson();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>流程设计器</title>
	<style type="text/css" media="screen">
		div.base {
			position: absolute;
			overflow: hidden;
			white-space: nowrap;
			font-family: Arial;
			font-size: 8pt;
		}
		div.base#graph {
			border-style: solid;
			border-color: #F2F2F2;
			border-width: 1px;
			background: url('/hhcommon/opensource/mxgraph/examples/editors/images/grid.gif');
		}
		
		
		
		.overlay {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 10;
	width: 100%;
	height: 100%;
	background-color: #fff;
	filter: alpha(opacity = 40);
	-moz-opacity: 0.4;
	opacity: 0.4;
	z-index: 2000000000001;
}
#loading {
	height: auto;
	position: absolute;
	border: 3px solid #ccc;
	left: 45%;
	top: 40%;
	padding: 2px;
	z-index: 2000000000001;
}

#loading .loading-indicator {
	background: white;
	color: #444;
	font: bold 12px Helvetica, Arial, sans-serif;
	height: auto;
	margin: 0;
	padding: 10px;
}
	</style>
		<script type="text/javascript">
mxBasePath = '/hhcommon/opensource/mxgraph/src';
</script>
		<%
			String userAgent = request.getHeader("User-Agent").toString();
			//System.out.println(userAgent + "   ");
			if (userAgent.indexOf("MSIE 6.") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ie.js">
</script>
		<%
			} else if (userAgent.indexOf("Firefox") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ff.js">
</script>
		<%
			} else if (userAgent.indexOf("Chrome") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-chrome.js">
</script>
		<%
			} else if (userAgent.indexOf("Opera") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-opera.js">
</script>
		<%
			} else if (userAgent.indexOf("Safari") > -1) {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-safari.js">
</script>
		<%
			} else {
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxclient-ie.js">
</script>
		<%
			}
		%>
		<script type="text/javascript" src="<%=basePath %>js/mxApplication.js">
</script>
		<script type="text/javascript">
mxConstants.DEFAULT_HOTSPOT = 1;
// Enables guides
mxGraphHandler.prototype.guidesEnabled = true;
// Alt disables guides
mxGuide.prototype.isEnabledForEvent = function(evt) {
	return !mxEvent.isAltDown(evt);
};

// Enables snapping waypoints to terminals
mxEdgeHandler.prototype.snapToTerminals = true;

window.onbeforeunload = function() {
	return mxResources.get('changesLost');
};
function createXml(str) {
    if (document.all) {
        var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
        xmlDom.loadXML(str);
        return xmlDom;
    }else{
    return new DOMParser().parseFromString(str, "text/xml");
    }
};

function attToObject(attributes){
	var object = {};
	for ( var i = 0; i < attributes.length; i++) {
			object[attributes[i].nodeName]=attributes[i].nodeValue;
	}
	return object;
}
var dataId = '<%=request.getParameter("dataId")==null?"":request.getParameter("dataId")%>';
var objectId = null;
var mxDocument = null;
</script>
<script type="text/javascript">
var loginUser  = eval('(' + '<%=gson.toJson(session.getAttribute("loginuser"))%>' + ')');
var theme = 'ext-all';
if(loginUser!=null&&loginUser!=''){
	if(loginUser.hhXtZmsx.theme){
		theme = loginUser.hhXtZmsx.theme;
	}
}
</script>
<%@ include file="../hhcommon/include/base.jsp"%>
<script type="text/javascript"
	src="system-class-javascript?path=
	<%=basePath %>properties/SimpleFormPanelWindow.js,
	<%=basePath %>properties/WorkFlow.js,
	<%=basePath %>properties/UserTask.js,
	<%=basePath %>properties/Edge.js,
	<%=basePath %>properties/Gateway.js"></script>
<script type="text/javascript">
var Init = {
		init : function() {
			new mxApplication('/hhcommon/opensource/mxgraph/examples/editors/config/workfloweditor.xml');
			setTimeout("Init.initHeight();", 100);
		},
		initHeight : function() {
			var height = BrowserContext.getBrowserHeight();
			if(height==0){
				height=500;
			}else{
				height=height-80;
			}
			Ext.override(com.hh.base.BaseWindow, {
				width : BrowserContext.getBrowserWidth() - 300,
				height : height
			});
			Ext.override(com.hh.base.BaseServicePanel, {
				width : BrowserContext.getBrowserWidth() - 300,
				height : height
			});
		}
	}
			this.parent.Doing.hidden(true);
</script>

</head>
<body onload="Init.init();">
	<div id="doing" class="overlay"   style="visibility: hidden;">
	</div>
	<div id="loading"  style="visibility: hidden;">
		<div class="loading-indicator">
			<img src="/hhcommon/images/loading/loading.gif" width="16" height="16"
				style="margin-right: 8px; float: left; vertical-align: top;" />执行中，请稍后......
				&nbsp;&nbsp;<a href="javascript:Doing.hidden(true);">关闭</a>
		</div>
	</div>
	<table id="splash" width="100%" height="100%"
		style="background:white;position:absolute;top:0px;left:0px;z-index:4;">
		<tr>
			<td align="center" valign="middle">
				<img src="<%=basePath %>images/loading.gif">
			</td>
		</tr>
	</table>
	<div id="graph" class="base">
		<!-- Graph Here -->
	</div>
	<div id="status" class="base" align="right">
		<!-- Status Here -->
	</div>
</body>
</html>
